<?php 

class Silk_Pms_Helper_Data extends Mage_Core_Helper_Abstract
{
    /**
     * get product info by sku
     */
    public function setproductBySku($sku,$websiteId)
    {
        $productId = Mage::getModel('catalog/product')->getIdBySku($sku);
        $collection = Mage::getModel("catalog/product")->getCollection();
        $collection->addattributetofilter("entity_id",$productId)
            ->addAttributeToSelect('thumbnail')
            ->addAttributeToSelect('price')
            ->addAttributeToSelect('description')
            ->addWebsiteFilter($websiteId);
        $iDefaultStoreId = Mage::app()->getWebsite($websiteId)->getDefaultGroup()->getDefaultStoreId();

        $collection->joinAttribute(
            'storename',
            'catalog_product/name',
            'entity_id',
            null,
            'inner',
            $iDefaultStoreId
        );

        return $collection->getData();
    }

    public function productInfoBysku($sku)
    {
        //通过sku获取商品的所有信息
        $_productId = Mage::getModel('catalog/product')->getIdBySku($sku);

        $_product = Mage::getModel('catalog/product')->load($_productId);

        return $_product;
    }
    

   



}